<?php

namespace App\Common\Traits;

use App\Models\PaymentOrder;
use Illuminate\Database\Eloquent\Relations\MorphToMany;

trait HasPaymentOrders
{
    public function paymentOrders(): MorphToMany
    {
        return $this->morphToMany(
            PaymentOrder::class,
            'subject',
            'model_has_payment_orders'
        )->withPivot('type');
    }
}
